const s = new Set();
[2,3,4,5,2,3,2].forEach(x=>s.add(x));

for (let i of s){
    console.log(i)
}

//...
const a = new Set([1,2,3,4]);
console.log(a);
console.log([...a]);

// forEach map
let arr = [1, 2, 3, 4, 5];

// var c = arr.map(n=>n*2);

console.log(arr.map(n=>n*2));
console.log(
    arr.map(num => num * 2).filter(num => num > 5)
)

function* fibonacci() {
    yield 1;
    yield 2;
}

var it = fibonacci();
console.log(it);          // "Generator {  }"
console.log(it.next());   // 1
console.log(it.next());   // 2
console.log(it.next()); //undefined

function* gen() {
    yield 0;
    yield 1;
    return 2;
    yield 3;
};
let g = gen();
console.log(g.next(),g.next(),g.next(),g.next());